<template>
  <div>

    <h3>自定义指令测试组件</h3>
    <p v-abc>{{ uname }}</p>

  </div>
</template>

<script>
export default {
  props: ['uname'],
  directives: {
    abc: {
      bind (el) {
        el.style.color = 'pink'
      },
      update (el) {
        console.log(el.innerHTML)    // uname更新之前的值
      },
      componentUpdated (el) {
        console.log(el.innerHTML)    // uname更新之后的值
      }
    }
  }
}
</script>

<style>

</style>